package org.leo.dm.util.beanvalidateexample;

import org.leo.dm.util.beanvalidate.InitRules;
import org.leo.dm.util.beanvalidate.RuleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BeanValidateExample {
	static Logger log = LoggerFactory.getLogger(BeanValidateExample.class);

	public static void main(String[] args) {
		try {
			XmlHeadParam xmlHeadParam = new XmlHeadParam();
			xmlHeadParam.setHASPAGED("4");
			String ruleXml = InitRules.init("XmlHeadParamVo", "/com/neusoft/dp/util/beanvalidateexample/XmlHeadParamVo.xml");// 配置规则ID和规则文件路径 获取规则
			String fieldStr = RuleService.validStr(xmlHeadParam, ruleXml);
			if (!"".equals(fieldStr.trim())) {
				log.info(fieldStr);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
